package org.onvivals.app.modules.iot.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onvivals.app.modules.auth.util.SaTokenUtil;
import org.onvivals.common.web.Result;
import org.onvivals.module.iot.entity.IotFirmware;
import org.onvivals.module.iot.service.IIotFirmwareService;
import org.onvivals.module.pms.entity.PmsRole;
import org.onvivals.module.pms.entity.PmsRoleIndividuality;
import org.onvivals.module.ums.entity.UmsUserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.List;

@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Tag(name = "小程序:固件更新")
@RequestMapping("/firmware")
public class IotFirmwareController {

	private final IIotFirmwareService iotFirmwareService;

	/**
	 * 根据id查询固件信息
	 */
	@Operation(summary = "根据id查询固件信息")
	@GetMapping("/{id}")
	public Result<IotFirmware> get(@PathVariable("id") Long id) {
		IotFirmware firmware = iotFirmwareService.getById(id);
		return Result.OK("查询成功", firmware);
	}

}
